﻿Public Class HinhThucThanhToan
    Public Shared Function them(ByVal tenht As String) As Boolean
        tenht = EscapeString(tenht)
        Return db.Query("INSERT INTO HinhThucThanhToan(TenHT) VALUES(N'" + tenht + "')")
    End Function
    Public Shared Function dsht() As DataTable
        Return db.QueryTable("SELECT * FROM HinhThucThanhToan")
    End Function
    Public Shared Function capnhat(ByVal maht As String, ByVal tenht As String) As Boolean
        maht = EscapeString(maht)
        tenht = EscapeString(tenht)
        Return db.Query("UPDATE HinhThucThanhToan SET TenHT =N'" + tenht + "' WHERE MaHT = '" + maht + "'")
    End Function
    Public Shared Function xoa(ByVal maht As String) As Boolean
        maht = EscapeString(maht)
        Return db.Query("DELETE FROM HinhThucThanhToan WHERE MaHT = '" + maht + "'")
    End Function
    Public Shared Function timkiem(ByVal tukhoa As String) As DataTable
        tukhoa = EscapeString(tukhoa)
        Return db.QueryTable("SELECT * FROM HinhThucThanhToan WHERE MaHT like  '%" + tukhoa + "%' or TenHT like  N'%" + tukhoa + "%'")
    End Function
End Class
